package com.leetcode.algorithm.y22.m09.w2;

/**
 * 2027. 转换字符串的最少操作次数
 * 
 * https://leetcode.cn/problems/minimum-moves-to-convert-string/
 * 
 * @author jie.deng
 *
 */
class Question2027Solution01 {

	public int minimumMoves(String s) {
		int len = s.length();
		int idx = 0;
		int cnt = 0;
		while (idx < len) {
			if (s.charAt(idx) == 'O') {
				idx++;
			} else {
				cnt++;
				idx += 3;
			}
		}
		return cnt;
	}

}